package com.clienterestful.util;


import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

public class RESTFulservice {
   
   private String       sURI = "http://localhost:8080/calendarioRESTFUL/webresources/";
   private WebResource  webResource;
   private Client       cliente;
   private ClientConfig config;
   
   public WebResource getWebResource(String recurso){
       this.config      = new DefaultClientConfig();
       this.cliente     = Client.create(config);
       this.webResource = cliente.resource(sURI).path(recurso);
               
       return this.webResource;
   }
   
   public  void setBaseUri(String uri){
       this.sURI=uri;
   }
   public String getBaseUri(){
       return this.sURI;
   }
}
